/*

Author   : chaos

FileName : const_cast.cpp

Date     : 12/08/17 00:19:52

*/
#include <iostream>
using namespace std;

class ConstCast
{
    private:
        int data;
    public:
        ConstCast(){data = 0;}
        int get_data() const;
};

int ConstCast::get_data() const
{
    const_cast<ConstCast *>(this)->data += 1;

    return data;
}

int main(int argc ,char *argv[])
{
    ConstCast Object;

    cout << "Data is " << Object.get_data() << " . " << endl;

   return 0;
}
